<%@ page language="java" pageEncoding="utf-8"%>
<%@page import="com.farm.web.constant.FarmConstant"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/view/conf/farmtag.tld" prefix="PF"%>
<style>
.cbtg-te-files-menu ul li {
	cursor: pointer;
}
</style>
<div id="dirFilesShortMenusWinId" class="modal fade cbtg-te-files-menu"
	tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
	<div class="modal-dialog modal-sm" role="document">
		<div class="modal-content">
			<div class="list-group"
				style="padding-bottom: 0px; margin-bottom: 0px;">
				<button id="button-add-dir" onclick="creatDirWin()"
					class="list-group-item ">添加目录</button>
				<button id="button-edit-dir" onclick="renameDirWin()"
					class="list-group-item ">修改目录</button>
				<button id="button-del-dir" onclick="delDirOrFile()"
					class="list-group-item ">刪除目录</button>
				<button id="button-add-file" onclick="creatFileWin()"
					class="list-group-item ">添加文件</button>
				<button id="button-edit-file" onclick="renameFileWin()"
					class="list-group-item ">修改文件名</button>
				<button id="button-del-file" onclick="delDirOrFile()"
					class="list-group-item ">刪除文件</button>
				<button id="button-choosedir-file" onclick="chooseFileDir()"
					class="list-group-item ">移动到</button>
			</div>
		</div>
	</div>
</div>

<div class="modal fade " id="dirFilesWinId" tabindex="-1" role="dialog"
	aria-labelledby="exampleModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-label="Close">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="exampleModalLabel"></h4>
			</div>
			<div class="modal-body">
				<form id="filesSubmitFormId">
					<div class="form-group">
						<label for="recipient-name" class="control-label"> <input
							type="hidden" id="file-model-isfile" value="false"> <span
							id="file-model"></span>名称:
						</label> <input type="text" class="form-control" id="file-name">
					</div>
					<div class="form-group" id="file-sort-box">
						<label for="recipient-name" class="control-label">排序:</label> <input
							type="text" class="form-control" id="file-sort">
					</div>
					<div class="form-group" id="file-note-box">
						<label for="message-text" class="control-label">备注:</label>
						<textarea class="form-control" id="file-note"></textarea>
					</div>
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" onclick="dirFilesWinSubmitFunc()" class="btn btn-primary">提交</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	var dirFilesWinSubmitFunc = function() {
		alert("请实现dirFilesWinSubmitFunc方法");
	};

	function initValidateFilesForm() {
		validateInput('file-name', function(id, val, obj) {
			// 用户名
			if (valid_isNull(val)) {
				return {
					valid : false,
					msg : '不能为空'
				};
			}
			if (!valid_maxLength(val, 2 - 1)) {
				return {
					valid : false,
					msg : '不能小于2个字符'
				};
			}
			if (valid_maxLength(val, 128)) {
				return {
					valid : false,
					msg : '不能大于16个字符'
				};
			}
			return {
				valid : true,
				msg : '正确'
			};
		});

		validateInput('file-sort', function(id, val, obj) {
			// 用户名
			if (valid_isNull(val)) {
				return {
					valid : false,
					msg : '不能为空'
				};
			}
			if (!valid_isNumber(val)) {
				return {
					valid : false,
					msg : '必须为整数'
				};
			}
			if (valid_maxLength(val, 16)) {
				return {
					valid : false,
					msg : '不能大于16个字符'
				};
			}
			return {
				valid : true,
				msg : '正确'
			};
		});
		validateInput('file-note', function(id, val, obj) {
			// 用户名
			if (valid_maxLength(val, 16)) {
				return {
					valid : false,
					msg : '不能大于64个字符'
				};
			}
			return {
				valid : true,
				msg : '正确'
			};
		});
	}
</script>